import rxAjax from '@/assets/js/ajax.js';

//布局权限设置 api接口
export const InsPortalPermissionApi = {};

InsPortalPermissionApi.baseUrl= '/api-portal/portal/core/insPortalPermission';
InsPortalPermissionApi.exportUrl= InsPortalPermissionApi.baseUrl + '/listExport';

//查询列表
InsPortalPermissionApi.query=function (parameter) {
  var url= InsPortalPermissionApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
 * 根据门户ID获取对应布局设计列表
 * @param pkId
 * @returns {*}
 */
InsPortalPermissionApi.getListByLayoutId =function(layoutId){
  var url= InsPortalPermissionApi.baseUrl + '/getListByLayoutId?layoutId=' + layoutId;
  return rxAjax.get(url);
}


/**
* 获取单记录
* @param pkId
* @returns {*}
*/
InsPortalPermissionApi.get =function(pkId) {
  var url= InsPortalPermissionApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}


//保存列表数据
InsPortalPermissionApi.saveAll =function(parameter) {
  var url= InsPortalPermissionApi.baseUrl + '/saveAll';
  return rxAjax.postJson(url,parameter);
}

//保存数据
InsPortalPermissionApi.save =function(parameter) {
  var url= InsPortalPermissionApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
InsPortalPermissionApi.del =function(parameter) {
  var url= InsPortalPermissionApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

export  default InsPortalPermissionApi;

